Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite GC page metadata for sweeping fast path #16632

Merged
merged 4 commits into from
Jun 3, 2016
Merged

Conversation

yuyichao
Copy link
Contributor

@yuyichao yuyichao commented May 28, 2016

This implements a slightly modified version of the page metadata part of the bit swapping generational GC (the part currently implemented is actually simpler due to not having to worry about the other gc bit...). @carnaval

  • Delete gc_bits and allocd in page metadata which are not enough to accurately
    record the necessary information.
  • Add has_marked and has_young to identify free pages and untouched pages.

TODO:

  • Implement the fast path for sweep2 (i.e. a quick sweep that is after a full sweep). This requires keeping a counter of live old objects in the page.
  • Implement a fallback full collection heuristic based on heap size as suggested by @vtjnash

Fixes #15543
Replaces #13993

@yuyichao yuyichao added the GC Garbage collector label May 28, 2016
@yuyichao yuyichao force-pushed the yyc/gc/full-thresh branch from 3d39168 to a4f6ad7 Compare May 28, 2016 22:32
// Note that before marking or after sweeping there can be live
// (and young) cells in the page for `!has_marked`.
uint16_t has_marked: 1;
// Whether any cell was live and yound **before sweeping**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

young

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops, I must really like 'd' these days. I typed count as cound many times while working on this.

@yuyichao yuyichao force-pushed the yyc/gc/full-thresh branch 5 times, most recently from 7db1980 to 60ce494 Compare May 29, 2016 22:56
@yuyichao yuyichao mentioned this pull request May 29, 2016
@yuyichao yuyichao force-pushed the yyc/gc/full-thresh branch 2 times, most recently from d7e6eae to 3de7ae6 Compare May 30, 2016 21:38
@yuyichao
Copy link
Contributor Author

yuyichao commented May 30, 2016

Just fixed a stupid bug in the full collection heuristics I added that was causing a runtime regression (and possibly memory) and this should be ready now.

I'd like to run this through the CI's a few more time to check. It'll also be nice if someone else could also verify the page metadata is valid. See here for the meanings of each bits and the motivation of the design can be found here.

@vtjnash @carnaval @carnaval

@yuyichao yuyichao force-pushed the yyc/gc/full-thresh branch from 3de7ae6 to 7f04c76 Compare May 30, 2016 22:08
@carnaval
Copy link
Contributor

Cool ! LGTM. That was smaller than I expected. We should still run a round of benchs because the heuristics are a little touchy.

@yuyichao yuyichao force-pushed the yyc/gc/full-thresh branch 5 times, most recently from e87217a to ad0c525 Compare June 1, 2016 15:05
@yuyichao yuyichao force-pushed the yyc/gc/full-thresh branch 4 times, most recently from 2f44b01 to 0695c27 Compare June 2, 2016 18:31
yuyichao added 4 commits June 2, 2016 22:52
* Delete `gc_bits` and `allocd` which are not enough to accurately
  record the necessary information.
* Add `has_marked` and `has_young` to identify free pages and untouched pages.

Fixes #15543
@yuyichao yuyichao force-pushed the yyc/gc/full-thresh branch from 0695c27 to 45a012e Compare June 3, 2016 02:52
@yuyichao yuyichao merged commit 7f95e1b into master Jun 3, 2016
@yuyichao yuyichao deleted the yyc/gc/full-thresh branch June 3, 2016 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GC Garbage collector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants